<template>
  <div>
    <el-tabs v-model="activeName">
      <el-tab-pane label="客户信息" name="first">
        <detail :userInfo="userInfo"></detail>
      </el-tab-pane>
      <el-tab-pane label="项目列表" name="second">
        <projects :tableData="userInfo.projects"></projects>
      </el-tab-pane>
      <el-tab-pane label="设备列表" name="third">
        <equipments :tableData="userInfo.equipments"></equipments>
      </el-tab-pane>
      <el-tab-pane label="处理记录" name="fourth">
          <handlelog :tableData="userInfo.handleLog"></handlelog>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import detail from "@/components/clients/details/info";
import equipments from "@/components/clients/details/equipments";
import projects from "@/components/clients/details/projects";
import Projects from '../../../components/clients/details/projects.vue';
import handlelog from '../../../components/clients/details/handleLog.vue';
export default {
  mounted() {},
  components: {
    detail,
    projects,
    equipments,
    handlelog
  },
  computed: {
    userInfo() {
      let code = this.$route.query.code;
      for (let i of this.userInfos) {
        if (i.code == code) {
          return i;
        }
      }
    },
  },
  data() {
    return {
      activeName: "first",
      userInfos: [
        {
          code: 1068,
          name: "广州气站",
          address: "上海市普陀区金沙江路 1518 弄",
          phone: "",
          contact: "",
          exp_code: "",
          mail: "",
          date: "2016-05-02",
          projects: [
            {
              code: 1009,
              name: "台肥锅炉设备",
              status: "正常",
              date: "2016-05-02",
            },
          ],
          equipments: [
            {
              img: "",
              id: "1553",
              name: "北方发电机01",
              model: "",
              status: "正常",
              date: "2016-05-02",
            },
          ],
          handleLog: []
        },
        {
          code: 1063,
          name: "深圳智物联",
          address: "上海市普陀区金沙江路 1517 弄",
          phone: "",
          contact: "",
          exp_code: "",
          mail: "",
          date: "2016-05-02",
        },
        {
          code: 1035,
          name: "深圳一号气站",
          address: "上海市普陀区金沙江路 1519 弄",
          phone: "",
          contact: "",
          exp_code: "",
          mail: "",
          date: "2016-05-02",
        },
        {
          code: 1036,
          name: "深圳二号气站",
          address: "上海市普陀区金沙江路 1516 弄",
          phone: "",
          contact: "",
          exp_code: "",
          mail: "",
          date: "2016-05-02",
        },
        {
          code: 1040,
          name: "深圳七号气站",
          address: "上海市普陀区金沙江路 1516 弄",
          phone: "",
          contact: "",
          exp_code: "",
          mail: "",
          date: "2016-05-02",
        },
        {
          code: 1045,
          name: "广州一号气站",
          address: "上海市普陀区金沙江路 1516 弄",
          phone: "",
          contact: "",
          exp_code: "",
          mail: "",
          date: "2016-05-02",
        },
        {
          code: 1046,
          name: "东莞二号气站",
          address: "上海市普陀区金沙江路 1516 弄",
          phone: "",
          contact: "",
          exp_code: "",
          mail: "",
          date: "2016-05-02",
        },
        {
          code: 1047,
          name: "惠州一号号气站",
          address: "上海市普陀区金沙江路 1516 弄",
          phone: "",
          contact: "",
          exp_code: "",
          mail: "",
          date: "2016-05-02",
        },
      ],
    };
  },
  methods: {
    // handleClick(tab, event) {
    //   console.log(tab, event);
    // },
  },
};
</script>

<style>
</style>